import { axios } from '@/utils/request'

export function getApproveTaskList (params) {
    return axios({
        url: 'approve/task',
        method: 'get',
        params
    })
}

export function getApproveHistoryList (params) {
    return axios({
        url: 'approve/history',
        method: 'get',
        params
    })
}

export function getApproveList (params) {
    return axios({
        url: 'approve',
        method: 'get',
        params
    })
}

export function getApproveReportList (params) {
    return axios({
        url: 'approve/report',
        method: 'get',
        params
    })
}

export function getApproveAccount (params) {
    return axios({
        url: 'approve/account',
        method: 'get',
        params
    })
}

export function addApproveAccount (data) {
    return axios({
        url: 'approve/account',
        method: 'post',
        data
    })
}

export function updateApproveAccount (id, data) {
    return axios({
        url: `approve/account/${ id }`,
        method: 'put',
        data
    })
}

export function delApproveAccount (id) {
    return axios({
        url: `approve/account/${ id }`,
        method: 'delete'
    })
}

export function getApproveDetail (id, params) {
    return axios({
        url: `approve/${ id }`,
        method: 'get',
        params
    })
}

export function handleApproveTask (id, data) {
    return axios({
        url: `approve/${ id }`,
        method: 'put',
        data
    })
}

export function assignTask (data) {
    return axios({
        url: 'approve/assign_task',
        method: 'post',
        data
    })
}
